package cn.avalon.feign;

import cn.avalon.domain.Store;
import cn.avalon.util.AjaxResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @description:
 * @author: Avalon
 * @date: 2022年09月19日 ： 22:28
 * @version: ver1.0
 * @email 709785494@qq.com
 */
@Component
public class StoreServiceFallbackFactory implements FallbackFactory<StoreService> {

    @Override
    public StoreService create(Throwable throwable) {
        return new StoreService() {
            @Override
            public AjaxResult add(Store store) {
                return new AjaxResult(false, "服务器繁忙，请稍后重试！");
            }
        };
    }
}
